unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


function   MouseToScreen(mVertical:   Boolean;   mMouse:   Integer):   Integer;
begin
      case   mVertical   of
          False:   Result   :=   Round(mMouse   *   (MAXWORD   /   Screen.Width));
      else
           Result   :=   Round(mMouse   *   (MAXWORD   /   Screen.Height));
      end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
 var
      vPoint:   TPoint;
begin
      vPoint.X := 500;
      vPoint.Y := 350;
      mouse_event(MOUSEEVENTF_ABSOLUTE   or   MOUSEEVENTF_MOVE,MouseToScreen(False,   vPoint.X),
                  MouseToScreen(True,   vPoint.Y),   0,   0);
      mouse_event(MOUSEEVENTF_ABSOLUTE   or   MOUSEEVENTF_LEFTDOWN,
                  MouseToScreen(False,   vPoint.X),   MouseToScreen(True,   vPoint.Y),   0,   0);
      Dec(vPoint.X,   200);
      Dec(vPoint.Y,   200);
      mouse_event(MOUSEEVENTF_ABSOLUTE   or   MOUSEEVENTF_MOVE,MouseToScreen(False,   vPoint.X),
                    MouseToScreen(True,   vPoint.Y),   0,   0);
      mouse_event(MOUSEEVENTF_ABSOLUTE   or   MOUSEEVENTF_LEFTUP,
                MouseToScreen(False,   vPoint.X),   MouseToScreen(True,   vPoint.Y),   0,   0);
end;

end.
